package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * ClassName:Hippo4jDemo
 * Description:
 *
 * @author Yql
 * @version 1.0
 * @Create 2024/5/27
 **/
@RestController
public class Hippo4jDemo {
    @Resource
    public ThreadPoolExecutor messageConsumeDynamicExecutor;

    @Resource
    public ThreadPoolExecutor messageProduceDynamicExecutor;

    @Resource
    public ThreadPoolExecutor origin_MessageConsumer;

    @RequestMapping("/DynamicThreadPoolTest")
    public void Dynamic_test(){
        messageConsumeDynamicExecutor.execute(() -> System.out.println("DynamicThreadPool_sayHello"));
    }

    @RequestMapping("/OriginThreadPoolTest")
    public void Origin_test(){
        origin_MessageConsumer.execute(() -> System.out.println("OriginThreadPool_sayHello"));
    }
}
